﻿using System;
using System.Collections;
using IllusionUtility.GetUtility;
using Manager;
using UnityEngine;

// Token: 0x02000278 RID: 632
public class CharMaleBody : global::CharBody
{
	// Token: 0x17000218 RID: 536
	// (get) Token: 0x06000F42 RID: 3906 RVA: 0x000700A0 File Offset: 0x0006E2A0
	// (set) Token: 0x06000F43 RID: 3907 RVA: 0x000700A8 File Offset: 0x0006E2A8
	public global::CharMaleCustom maleCustom { get; set; }

	// Token: 0x17000219 RID: 537
	// (get) Token: 0x06000F44 RID: 3908 RVA: 0x000700B4 File Offset: 0x0006E2B4
	// (set) Token: 0x06000F45 RID: 3909 RVA: 0x000700BC File Offset: 0x0006E2BC
	public global::CharMaleClothes maleClothes { get; set; }

	// Token: 0x1700021A RID: 538
	// (get) Token: 0x06000F46 RID: 3910 RVA: 0x000700C8 File Offset: 0x0006E2C8
	// (set) Token: 0x06000F47 RID: 3911 RVA: 0x000700D0 File Offset: 0x0006E2D0
	public SkinnedMeshRenderer smrSimpleBody { get; set; }

	// Token: 0x1700021B RID: 539
	// (get) Token: 0x06000F48 RID: 3912 RVA: 0x000700DC File Offset: 0x0006E2DC
	// (set) Token: 0x06000F49 RID: 3913 RVA: 0x000700E4 File Offset: 0x0006E2E4
	public SkinnedMeshRenderer smrSimpleTongue { get; set; }

	// Token: 0x1700021C RID: 540
	// (get) Token: 0x06000F4A RID: 3914 RVA: 0x000700F0 File Offset: 0x0006E2F0
	// (set) Token: 0x06000F4B RID: 3915 RVA: 0x000700F8 File Offset: 0x0006E2F8
	public SkinnedMeshRenderer smrSimpleHand { get; set; }

	// Token: 0x06000F4C RID: 3916 RVA: 0x00070104 File Offset: 0x0006E304
	public virtual void Initialize(global::CharInfo info)
	{
		base.Init(info);
		this.deleteBodyBoneName = "cm_J_Root";
		this.deleteHeadBoneName = "cm_J_FaceRoot";
		this.maleFile = (base.chaFile as global::CharMaleFile);
		this.maleCustomInfo = (base.customInfo as global::CharFileInfoCustomMale);
		this.maleClothesInfo = (base.clothesInfo as global::CharFileInfoClothesMale);
		this.maleStatusInfo = (base.statusInfo as global::CharFileInfoStatusMale);
		global::CharMaleCustom charMaleCustom = new global::CharMaleCustom(info);
		this.maleCustom = charMaleCustom;
		base.charCustom = charMaleCustom;
		global::CharMaleClothes charMaleClothes = new global::CharMaleClothes(info);
		this.maleClothes = charMaleClothes;
		base.charClothes = charMaleClothes;
		base.InitBaseCustomTextureBody(0);
		this.smrSimpleBody = null;
		this.smrSimpleHand = null;
		this.smrSimpleTongue = null;
		this.sonRotTime = 1f;
		this.sonRotDeltaTime = 0f;
	}

	// Token: 0x06000F4D RID: 3917 RVA: 0x000701D0 File Offset: 0x0006E3D0
	public virtual bool Load(bool changeStatus = false)
	{
		base.StartCoroutine(this.LoadAsync(changeStatus, false));
		return true;
	}

	// Token: 0x06000F4E RID: 3918 RVA: 0x000701E4 File Offset: 0x0006E3E4
	public virtual IEnumerator LoadAsync(bool changeStatus = false, bool asyncFlags = true)
	{
		byte[] backupState = null;
		if (changeStatus)
		{
			backupState = this.maleStatusInfo.SaveBytes();
		}
		base.Release();
		if (asyncFlags)
		{
			yield return null;
		}
		base.objTop = new GameObject("BodyTop");
		GameObject objRoot = base.chaInfo.objRoot;
		if (objRoot)
		{
			base.objTop.transform.SetParent(objRoot.transform, false);
		}
		if (asyncFlags)
		{
			base.objTop.SetActive(false);
		}
		this.maleCustom.AddUpdateCMBodyTexFlags(true, true);
		this.maleCustom.AddUpdateCMBodyColorFlags(true, true);
		this.maleCustom.CreateBodyTexture();
		string assetBundleName = "chara/cm_base.unity3d";
		string assetName = "p_cm_anim";
		if (asyncFlags)
		{
			yield return base.StartCoroutine(base.Load_Coroutine<GameObject>(assetBundleName, assetName, delegate(GameObject x)
			{
				base.objAnim = x;
			}, true, false, null));
		}
		else
		{
			base.objAnim = global::CommonLib.LoadAsset<GameObject>(assetBundleName, assetName, true, string.Empty);
		}
		global::Singleton<Manager.Character>.Instance.AddLoadAssetBundle(assetBundleName);
		if (!base.objAnim)
		{
			yield break;
		}
		base.animBody = base.objAnim.GetComponent<Animator>();
		base.objAnim.transform.SetParent(base.objTop.transform, false);
		base.animIKCtrl = base.objAnim.GetComponent<global::AnimeIKCtrl>();
		if (base.animIKCtrl)
		{
			base.animIKCtrl._editInfo = base.charCustom;
		}
		base.objBone = base.objAnim.transform.FindLoop("cm_J_Root");
		if (base.objBone)
		{
			GameObject objN_Hand_L = base.objBone.transform.FindLoop("N_Hand_L");
			if (null != objN_Hand_L)
			{
				GameObject objStudioHandL = new GameObject("N_Hand_L_NEO");
				objStudioHandL.transform.SetParent(objN_Hand_L.transform.parent, false);
				objStudioHandL.transform.localPosition = objN_Hand_L.transform.localPosition;
				objStudioHandL.transform.localRotation = objN_Hand_L.transform.localRotation;
				objStudioHandL.transform.localScale = Vector3.one;
			}
			this.aaWeightsBody.CreateBoneList(base.objBone, "cm_J");
			base.chaInfo.CreateReferenceInfo(1UL, base.objBone);
			global::NeckLookControllerVer2[] nlc = base.objBone.GetComponentsInChildren<global::NeckLookControllerVer2>(true);
			if (nlc.Length != 0)
			{
				base.neckLookCtrl = nlc[0];
			}
			if (base.neckLookCtrl)
			{
				base.chaInfo.ChangeLookNeckTarget(this.maleStatusInfo.neckTargetNo, null, 1f);
				base.chaInfo.ChangeLookNeckPtn(1);
			}
		}
		base.ikObjRefresh = new global::CharBody.IKObjectRefresh();
		base.ikObjRefresh.CreateInfo(base.objAnim, "k_m_");
		string assetBundleName2 = "chara/cm_base.unity3d";
		string assetName2 = "p_cm_head_bone";
		if (asyncFlags)
		{
			yield return base.StartCoroutine(base.Load_Coroutine<GameObject>(assetBundleName2, assetName2, delegate(GameObject x)
			{
				base.objHeadBone = x;
			}, true, false, null));
		}
		else
		{
			base.objHeadBone = global::CommonLib.LoadAsset<GameObject>(assetBundleName2, assetName2, true, string.Empty);
		}
		global::Singleton<Manager.Character>.Instance.AddLoadAssetBundle(assetBundleName2);
		if (base.objHeadBone)
		{
			GameObject objHeadParent = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.HeadParent);
			base.objHeadBone.transform.SetParent(objHeadParent.transform, false);
			global::EyeLookController[] elc = base.objHeadBone.GetComponentsInChildren<global::EyeLookController>(true);
			if (elc.Length != 0)
			{
				base.eyeLookCtrl = elc[0];
			}
			if (base.eyeLookCtrl)
			{
				global::EyeLookCalc eyeLookCalc = base.eyeLookCtrl.GetComponent<global::EyeLookCalc>();
				if (eyeLookCalc)
				{
					eyeLookCalc.Init();
					base.chaInfo.ChangeLookEyesTarget(this.maleStatusInfo.eyesTargetNo, null, 1f);
					base.chaInfo.ChangeLookEyesPtn(1);
				}
			}
			this.aaWeightsHead.CreateBoneList(base.objHeadBone, "cm_J");
			string assetBundleName3 = "chara/cm_base.unity3d";
			string assetName3 = "p_cm_body_00";
			if (asyncFlags)
			{
				yield return base.StartCoroutine(base.Load_Coroutine<GameObject>(assetBundleName3, assetName3, delegate(GameObject x)
				{
					base.objBody = x;
				}, true, false, null));
			}
			else
			{
				base.objBody = global::CommonLib.LoadAsset<GameObject>(assetBundleName3, assetName3, true, string.Empty);
			}
			global::Singleton<Manager.Character>.Instance.AddLoadAssetBundle(assetBundleName3);
			if (base.objBody)
			{
				base.chaInfo.CreateReferenceInfo(2UL, base.objBody);
				base.objBody.transform.SetParent(base.objTop.transform, false);
				GameObject objRootBone = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.A_ROOTBONE);
				Transform trfRootBone = (!objRootBone) ? null : objRootBone.transform;
				this.aaWeightsBody.AssignedWeights(base.objBody, this.deleteBodyBoneName, trfRootBone);
				base.charCustom.InitShapeBody(base.objBone.transform);
			}
			if (asyncFlags)
			{
				yield return null;
			}
			string assetBundleName4 = "chara/cm_base.unity3d";
			string assetName4 = "p_cm_body_mnpb";
			if (asyncFlags)
			{
				yield return base.StartCoroutine(base.Load_Coroutine<GameObject>(assetBundleName4, assetName4, delegate(GameObject x)
				{
					base.objBase = x;
				}, true, false, null));
			}
			else
			{
				base.objBase = global::CommonLib.LoadAsset<GameObject>(assetBundleName4, assetName4, true, string.Empty);
			}
			global::Singleton<Manager.Character>.Instance.AddLoadAssetBundle(assetBundleName4);
			if (base.objBase)
			{
				base.objBase.transform.SetParent(base.objTop.transform, false);
				base.chaInfo.CreateReferenceInfo(8UL, base.objBase);
				GameObject objRootBone2 = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.A_ROOTBONE);
				Transform trfRootBone2 = (!objRootBone2) ? null : objRootBone2.transform;
				this.aaWeightsBody.AssignedWeights(base.objBase, this.deleteBodyBoneName, trfRootBone2);
				string[] moz = new string[]
				{
					"cm_O_dan00",
					"cm_O_dan_f"
				};
				base.MozInit(moz);
				base.charCustom.ChangeCustomBodyWithoutCustomTexture();
				GameObject objMesh = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.S_SimpleBody);
				if (objMesh)
				{
					SkinnedMeshRenderer[] smr = objMesh.GetComponentsInChildren<SkinnedMeshRenderer>(true);
					if (smr.Length != 0)
					{
						this.smrSimpleBody = smr[0];
					}
				}
				objMesh = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.S_SimpleHand);
				if (objMesh)
				{
					SkinnedMeshRenderer[] smr2 = objMesh.GetComponentsInChildren<SkinnedMeshRenderer>(true);
					if (smr2.Length != 0)
					{
						this.smrSimpleHand = smr2[0];
					}
				}
				objMesh = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.S_SimpleTongue);
				if (objMesh)
				{
					SkinnedMeshRenderer[] smr3 = objMesh.GetComponentsInChildren<SkinnedMeshRenderer>(true);
					if (smr3.Length != 0)
					{
						this.smrSimpleTongue = smr3[0];
					}
				}
			}
			if (asyncFlags)
			{
				yield return null;
			}
			if (asyncFlags)
			{
				yield return base.StartCoroutine(this.ChangeHeadAsync(true));
			}
			else
			{
				this.ChangeHead(true);
			}
			if (asyncFlags)
			{
				yield return base.StartCoroutine(this.ChangeHairAsync(true));
			}
			else
			{
				this.ChangeHair(true);
			}
			if (asyncFlags)
			{
				yield return base.StartCoroutine(this.ChangeClothesAsync(true));
			}
			else
			{
				this.ChangeClothes(true);
			}
			if (asyncFlags)
			{
				yield return base.StartCoroutine(base.ChangeAccessoryAsync(true));
			}
			else
			{
				base.ChangeAccessory(true);
			}
			if (changeStatus)
			{
				this.maleStatusInfo.LoadBytes(backupState, 4);
			}
			Resources.UnloadUnusedAssets();
			GC.Collect();
			base.LoadEnd = true;
			yield return null;
			yield break;
		}
		yield break;
	}

	// Token: 0x06000F4F RID: 3919 RVA: 0x0007021C File Offset: 0x0006E41C
	public virtual void Reload(bool noChangeClothes = false, bool noChangeHead = false, bool noChangeHair = false)
	{
		this.maleCustom.AddUpdateCMBodyTexFlags(true, true);
		this.maleCustom.AddUpdateCMBodyColorFlags(true, true);
		this.maleCustom.CreateBodyTexture();
		if (!noChangeHead)
		{
			this.ChangeHead(true);
		}
		if (!noChangeHair)
		{
			this.ChangeHair(true);
		}
		if (!noChangeClothes)
		{
			this.ChangeClothes(true);
			base.ChangeAccessory(true);
		}
		this.maleCustom.UpdateShapeBodyValueFromCustomInfo();
		this.maleCustom.UpdateShapeFaceValueFromCustomInfo();
		base.charCustom.ChangeCustomBodyWithoutCustomTexture();
		base.charClothes.UpdateClothesStateAll();
		Resources.UnloadUnusedAssets();
		GC.Collect();
	}

	// Token: 0x06000F50 RID: 3920 RVA: 0x000702B8 File Offset: 0x0006E4B8
	public virtual void ChangeHead(bool forceChange = false)
	{
		base.StartCoroutine(this.ChangeHeadAsync(base.customInfo.headId, forceChange, false));
	}

	// Token: 0x06000F51 RID: 3921 RVA: 0x000702D4 File Offset: 0x0006E4D4
	public virtual void ChangeHead(int _headId, bool forceChange = false)
	{
		base.StartCoroutine(this.ChangeHeadAsync(_headId, forceChange, false));
	}

	// Token: 0x06000F52 RID: 3922 RVA: 0x000702E8 File Offset: 0x0006E4E8
	public virtual IEnumerator ChangeHeadAsync(bool forceChange = false)
	{
		yield return base.StartCoroutine(this.ChangeHeadAsync(base.customInfo.headId, forceChange, true));
		yield break;
	}

	// Token: 0x06000F53 RID: 3923 RVA: 0x00070314 File Offset: 0x0006E514
	public virtual IEnumerator ChangeHeadAsync(int _headId, bool forceChange = false, bool asyncFlags = true)
	{
		if (_headId == -1)
		{
			yield break;
		}
		if (!forceChange && null != base.objHead && _headId == base.customInfo.headId)
		{
			yield break;
		}
		if (base.objHead)
		{
			base.objHead.transform.SetParent(null);
			base.objHead.name = "delete";
			UnityEngine.Object.Destroy(base.objHead);
			base.objHead = null;
			base.infoHead = null;
			base.chaInfo.ReleaseRefObject(3UL);
			base.chaInfo.ReleaseTagObject(3UL);
			base.chaInfo.ReleaseTagObject(30UL);
			base.charCustom.ReleaseShapeFace();
		}
		if (asyncFlags)
		{
			IEnumerator cor = base.LoadCharaFbxDataAsync(delegate(GameObject o)
			{
				base.objHead = o;
			}, typeof(global::CharaListInfo.TypeMaleFbx), 0, _headId, "cm_head", false, 0, null, 0, true, false);
			yield return base.StartCoroutine(cor);
		}
		else
		{
			base.objHead = base.LoadCharaFbxData(typeof(global::CharaListInfo.TypeMaleFbx), 0, _headId, "cm_head", false, 0, null, 0, false);
		}
		if (base.objHead)
		{
			global::CommonLib.CopySameNameTransform(base.objHeadBone.transform, base.objHead.transform);
			base.objHead.transform.SetParent(base.objHeadBone.transform, false);
			this.aaWeightsHead.AssignedWeights(base.objHead, this.deleteHeadBoneName, null);
			global::ListTypeFbxComponent ltfComponent = base.objHead.GetComponent<global::ListTypeFbxComponent>();
			global::ListTypeFbx ltfData = ltfComponent.ltfData;
			base.infoHead = ltfData;
			global::ListTypeFbx ltf = ltfData;
			base.fbsCtrl = base.objHead.GetComponent<global::FaceBlendShape>();
			if (null != base.fbsCtrl)
			{
				base.eyesCtrl = base.fbsCtrl.EyesCtrl;
				base.mouthCtrl = base.fbsCtrl.MouthCtrl;
				base.chaInfo.ChangeEyesPtn(base.statusInfo.eyesPtn, true);
				base.chaInfo.ChangeMouthPtn(base.statusInfo.mouthPtn, true);
			}
			base.customInfo.headId = ltf.Id;
			base.chaInfo.CreateReferenceInfo(3UL, base.objHeadBone);
			base.chaInfo.CreateTagInfo(3UL, base.objHeadBone);
			base.chaInfo.CreateTagInfo(30UL, base.objHeadBone);
			base.InitBaseCustomTextureFace(0, ltf.Etc[1], ltf.Etc[2]);
			this.maleCustom.AddUpdateCMFaceTexFlags(true, true);
			this.maleCustom.AddUpdateCMFaceColorFlags(true, true);
			this.maleCustom.CreateFaceTexture();
			this.maleCustom.SetFaceBaseMaterial();
			base.charCustom.InitShapeFace(base.objHeadBone.transform, ltf.ABPath, ltf.Etc[0]);
			base.charCustom.ChangeCustomFaceWithoutCustomTexture();
		}
		if (asyncFlags)
		{
			yield return null;
		}
		Resources.UnloadUnusedAssets();
		yield return null;
		yield break;
	}

	// Token: 0x06000F54 RID: 3924 RVA: 0x0007035C File Offset: 0x0006E55C
	public virtual void LoadMannequinHead()
	{
		string assetBundleName = "chara/cm_base.unity3d";
		string assetName = "p_cm_mannequin_head";
		base.objMannequinHead = global::CommonLib.LoadAsset<GameObject>(assetBundleName, assetName, true, string.Empty);
		global::Singleton<Manager.Character>.Instance.AddLoadAssetBundle(assetBundleName);
		if (base.objMannequinHead)
		{
			GameObject referenceInfo = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.HeadParent);
			base.objMannequinHead.transform.SetParent(referenceInfo.transform, false);
			this.aaWeightsHead.AssignedWeights(base.objMannequinHead, this.deleteHeadBoneName, null);
		}
	}

	// Token: 0x06000F55 RID: 3925 RVA: 0x000703E0 File Offset: 0x0006E5E0
	public virtual void ChangeHair(bool forceChange = false)
	{
		base.StartCoroutine(this.ChangeHairAsync(base.customInfo.hairId[0], forceChange, false));
	}

	// Token: 0x06000F56 RID: 3926 RVA: 0x00070400 File Offset: 0x0006E600
	public virtual void ChangeHair(int _hairBId = -1, bool forceChange = false)
	{
		base.StartCoroutine(this.ChangeHairAsync(_hairBId, forceChange, false));
	}

	// Token: 0x06000F57 RID: 3927 RVA: 0x00070414 File Offset: 0x0006E614
	public virtual IEnumerator ChangeHairAsync(bool forceChange = false)
	{
		yield return base.StartCoroutine(this.ChangeHairAsync(base.customInfo.hairId[0], forceChange, true));
		yield break;
	}

	// Token: 0x06000F58 RID: 3928 RVA: 0x00070440 File Offset: 0x0006E640
	public virtual IEnumerator ChangeHairAsync(int _hairBId = -1, bool forceChange = false, bool asyncFlags = true)
	{
		int[] _hairId = new int[]
		{
			_hairBId
		};
		global::CharaListInfo.TypeMaleFbx[] fbxType = new global::CharaListInfo.TypeMaleFbx[]
		{
			global::CharaListInfo.TypeMaleFbx.cm_f_hair
		};
		string[] hairName = new string[]
		{
			"cm_hairB"
		};
		ulong[] hairTag = new ulong[]
		{
			4UL
		};
		int[] defId = new int[1];
		for (int i = 0; i < _hairId.Length; i++)
		{
			int id = _hairId[i];
			if (id != -1)
			{
				if (forceChange || !(null != base.objHair[i]) || id != base.customInfo.hairId[i])
				{
					if (base.objHair[i])
					{
						UnityEngine.Object.Destroy(base.objHair[i]);
						base.objHair[i] = null;
						base.infoHair[i] = null;
						base.chaInfo.ReleaseTagObject(hairTag[i]);
					}
					GameObject objHairParent = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.HairParent);
					if (asyncFlags)
					{
						IEnumerator cor = base.LoadCharaFbxDataAsync(delegate(GameObject o)
						{
							base.objHair[i] = o;
						}, typeof(global::CharaListInfo.TypeMaleFbx), (int)fbxType[i], id, hairName[i], false, 0, objHairParent.transform, defId[i], true, false);
						yield return base.StartCoroutine(cor);
					}
					else
					{
						base.objHair[i] = base.LoadCharaFbxData(typeof(global::CharaListInfo.TypeMaleFbx), (int)fbxType[i], id, hairName[i], false, 0, objHairParent.transform, defId[i], false);
					}
					if (base.objHair[i])
					{
						global::ListTypeFbxComponent ltfComponent = base.objHair[i].GetComponent<global::ListTypeFbxComponent>();
						global::ListTypeFbx ltf = base.infoHair[i] = ltfComponent.ltfData;
						base.customInfo.hairId[i] = ltf.Id;
						base.chaInfo.CreateTagInfo(hairTag[i], base.objHair[i]);
						this.maleCustom.ChangeHairColor(i);
						this.maleCustom.ChangeHairAcsColor(i);
					}
				}
			}
		}
		if (asyncFlags)
		{
			yield return null;
		}
		Resources.UnloadUnusedAssets();
		yield return null;
		yield break;
	}

	// Token: 0x06000F59 RID: 3929 RVA: 0x00070488 File Offset: 0x0006E688
	public virtual void ChangeClothes(bool forceChange = false)
	{
		base.StartCoroutine(this.ChangeClothesAsync(base.clothesInfo.clothesId[0], base.clothesInfo.clothesId[1], forceChange, false));
	}

	// Token: 0x06000F5A RID: 3930 RVA: 0x000704B4 File Offset: 0x0006E6B4
	public virtual void ChangeClothes(int _clothesId = -1, int _shoesId = -1, bool forceChange = false)
	{
		base.StartCoroutine(this.ChangeClothesAsync(_clothesId, _shoesId, forceChange, false));
	}

	// Token: 0x06000F5B RID: 3931 RVA: 0x000704C8 File Offset: 0x0006E6C8
	public virtual IEnumerator ChangeClothesAsync(bool forceChange = false)
	{
		yield return base.StartCoroutine(this.ChangeClothesAsync(base.clothesInfo.clothesId[0], base.clothesInfo.clothesId[1], forceChange, true));
		yield break;
	}

	// Token: 0x06000F5C RID: 3932 RVA: 0x000704F4 File Offset: 0x0006E6F4
	public virtual IEnumerator ChangeClothesAsync(int _clothesId = -1, int _shoesId = -1, bool forceChange = false, bool asyncFlags = true)
	{
		if (asyncFlags)
		{
			yield return base.StartCoroutine(this.ChangeClothesBaseAsync(_clothesId, forceChange, true));
			yield return base.StartCoroutine(this.ChangeClothesShoesAsync(_shoesId, forceChange, true));
		}
		else
		{
			this.ChangeClothesBase(_clothesId, forceChange);
			this.ChangeClothesShoes(_shoesId, forceChange);
		}
		yield return null;
		yield break;
	}

	// Token: 0x06000F5D RID: 3933 RVA: 0x0007054C File Offset: 0x0006E74C
	public virtual void ChangeClothesBase(int _clothesId, bool forceChange = false)
	{
		base.StartCoroutine(this.ChangeClothesBaseAsync(_clothesId, forceChange, false));
	}

	// Token: 0x06000F5E RID: 3934 RVA: 0x00070560 File Offset: 0x0006E760
	public virtual IEnumerator ChangeClothesBaseAsync(int _clothesId, bool forceChange = false, bool asyncFlags = true)
	{
		bool load = true;
		bool release = true;
		int kindNo = 0;
		if (_clothesId == -1)
		{
			load = false;
			release = false;
		}
		if (!forceChange && null != base.objClothes[kindNo] && _clothesId == this.maleClothesInfo.clothesId[kindNo])
		{
			load = false;
			release = false;
		}
		if (release && base.objClothes[kindNo])
		{
			UnityEngine.Object.Destroy(base.objClothes[kindNo]);
			base.objClothes[kindNo] = null;
			base.infoClothes[kindNo] = null;
			base.chaInfo.ReleaseTagObject(9UL);
			this.maleClothes.RemoveStateKind(0);
		}
		if (load)
		{
			if (asyncFlags)
			{
				yield return null;
			}
			if (asyncFlags)
			{
				IEnumerator cor = base.LoadCharaFbxDataAsync(delegate(GameObject o)
				{
					base.objClothes[kindNo] = o;
				}, typeof(global::CharaListInfo.TypeMaleFbx), 2, _clothesId, "cm_clothes", true, 1, base.objTop.transform, 0, true, false);
				yield return base.StartCoroutine(cor);
			}
			else
			{
				base.objClothes[kindNo] = base.LoadCharaFbxData(typeof(global::CharaListInfo.TypeMaleFbx), 2, _clothesId, "cm_clothes", true, 1, base.objTop.transform, 0, false);
			}
			if (asyncFlags)
			{
				yield return null;
			}
			if (base.objClothes[kindNo])
			{
				global::ListTypeFbxComponent ltfComponent = base.objClothes[kindNo].GetComponent<global::ListTypeFbxComponent>();
				global::ListTypeFbx ltf = base.infoClothes[kindNo] = ltfComponent.ltfData;
				base.clothesInfo.clothesId[kindNo] = ltf.Id;
				base.chaInfo.CreateTagInfo(9UL, base.objBase);
				base.chaInfo.CreateTagInfo(9UL, base.objBody);
				base.chaInfo.CreateTagInfo(9UL, base.objClothes[kindNo]);
				this.maleClothes.AddStateKind(0, ltf.Etc[0]);
				this.maleCustom.SetBodyBaseMaterial();
			}
		}
		if (base.objClothes[kindNo])
		{
			this.maleClothes.ChangeClothesColor(kindNo);
		}
		yield return null;
		yield break;
	}

	// Token: 0x06000F5F RID: 3935 RVA: 0x000705A8 File Offset: 0x0006E7A8
	public virtual void ChangeClothesShoes(int _shoesId, bool forceChange = false)
	{
		base.StartCoroutine(this.ChangeClothesShoesAsync(_shoesId, forceChange, false));
	}

	// Token: 0x06000F60 RID: 3936 RVA: 0x000705BC File Offset: 0x0006E7BC
	public virtual IEnumerator ChangeClothesShoesAsync(int _shoesId, bool forceChange = false, bool asyncFlags = true)
	{
		bool load = true;
		bool release = true;
		int kindNo = 1;
		if (_shoesId == -1)
		{
			load = false;
			release = false;
		}
		if (!forceChange && null != base.objClothes[kindNo] && _shoesId == this.maleClothesInfo.clothesId[kindNo])
		{
			load = false;
			release = false;
		}
		if (release && base.objClothes[kindNo])
		{
			UnityEngine.Object.Destroy(base.objClothes[kindNo]);
			base.objClothes[kindNo] = null;
			base.infoClothes[kindNo] = null;
			base.chaInfo.ReleaseTagObject(19UL);
			this.maleClothes.RemoveStateKind(1);
		}
		if (load)
		{
			if (asyncFlags)
			{
				yield return null;
			}
			if (asyncFlags)
			{
				IEnumerator cor = base.LoadCharaFbxDataAsync(delegate(GameObject o)
				{
					base.objClothes[kindNo] = o;
				}, typeof(global::CharaListInfo.TypeMaleFbx), 3, _shoesId, "cm_shoes", false, 1, base.objTop.transform, 0, true, false);
				yield return base.StartCoroutine(cor);
			}
			else
			{
				base.objClothes[kindNo] = base.LoadCharaFbxData(typeof(global::CharaListInfo.TypeMaleFbx), 3, _shoesId, "cm_shoes", false, 1, base.objTop.transform, 0, false);
			}
			if (asyncFlags)
			{
				yield return null;
			}
			if (base.objClothes[kindNo])
			{
				global::ListTypeFbxComponent ltfComponent = base.objClothes[kindNo].GetComponent<global::ListTypeFbxComponent>();
				global::ListTypeFbx ltf = base.infoClothes[kindNo] = ltfComponent.ltfData;
				base.clothesInfo.clothesId[kindNo] = ltf.Id;
				base.chaInfo.CreateTagInfo(19UL, base.objClothes[kindNo]);
				this.maleClothes.AddStateKind(1, ltf.Etc[0]);
			}
		}
		if (base.objClothes[kindNo])
		{
			this.maleClothes.ChangeClothesColor(kindNo);
		}
		yield return null;
		yield break;
	}

	// Token: 0x06000F61 RID: 3937 RVA: 0x00070604 File Offset: 0x0006E804
	public virtual bool InitializeExpression(bool _enable = true)
	{
		string text = "list/expression.unity3d";
		string text2 = "cm_expression";
		if (!global::AssetBundleCheck.IsFile(text, text2))
		{
			string message = "読み込みエラー\r\nassetBundleName：" + text + "\tassetName：" + text2;
			global::Debug.LogWarning(message);
			return false;
		}
		base.expression = base.chaInfo.objRoot.AddComponent<global::Expression>();
		base.expression.LoadSetting(text, text2);
		base.expression.SetCharaTransform(base.chaInfo.objRoot.transform);
		base.expression.Initialize();
		base.expression.enable = _enable;
		return true;
	}

	// Token: 0x06000F62 RID: 3938 RVA: 0x0007069C File Offset: 0x0006E89C
	public override void ReleaseSub()
	{
		this.smrSimpleBody = null;
		this.smrSimpleHand = null;
		this.smrSimpleTongue = null;
		this.sonRotTime = 1f;
		this.sonRotDeltaTime = 0f;
		this.maleClothes.dictStateType.Clear();
	}

	// Token: 0x06000F63 RID: 3939 RVA: 0x000706DC File Offset: 0x0006E8DC
	public override void UpdateVisible()
	{
		bool flag = false;
		byte b = 1;
		bool flag2 = true;
		bool[] flags = new bool[]
		{
			base.chaInfo.visibleAll
		};
		if (global::YS_Assist.SetActiveControl(base.objBase, flags))
		{
			flag = true;
		}
		bool[] flags2 = new bool[]
		{
			this.maleStatusInfo.tongueState != 0,
			0 != b,
			1 == this.maleStatusInfo.visibleBodyAlways,
			!this.maleStatusInfo.visibleSimple
		};
		GameObject referenceInfo = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.S_TongueB);
		if (global::YS_Assist.SetActiveControl(referenceInfo, flags2))
		{
			flag = true;
		}
		bool[] flags3 = new bool[]
		{
			this.maleStatusInfo.clothesState[0] != 0 || this.maleStatusInfo.visibleSimple || this.maleStatusInfo.visibleSon,
			flag2,
			this.maleStatusInfo.visibleSonAlways,
			!this.mannequinMode
		};
		GameObject referenceInfo2 = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.S_Son);
		if (global::YS_Assist.SetActiveControl(referenceInfo2, flags3))
		{
			flag = true;
		}
		bool[] flags4 = new bool[]
		{
			!this.mannequinMode
		};
		GameObject referenceInfo3 = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.S_UHair);
		if (global::YS_Assist.SetActiveControl(referenceInfo3, flags4))
		{
			flag = true;
		}
		bool[] flags5 = new bool[]
		{
			base.chaInfo.visibleAll,
			this.maleStatusInfo.clothesState[0] == 0,
			1 == b,
			1 == this.maleStatusInfo.visibleBodyAlways,
			!this.maleStatusInfo.visibleSimple
		};
		if (global::YS_Assist.SetActiveControl(base.objClothes[0], flags5))
		{
			flag = true;
		}
		bool[] flags6 = new bool[]
		{
			base.chaInfo.visibleAll,
			this.maleStatusInfo.clothesState[0] != 0,
			1 == b,
			1 == this.maleStatusInfo.visibleBodyAlways,
			!this.maleStatusInfo.visibleSimple
		};
		if (global::YS_Assist.SetActiveControl(base.objBody, flags6))
		{
			flag = true;
		}
		bool[] flags7 = new bool[]
		{
			base.chaInfo.visibleAll,
			2 == b,
			1 == this.maleStatusInfo.visibleBodyAlways,
			!this.maleStatusInfo.visibleSimple
		};
		GameObject referenceInfo4 = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.S_Hand);
		if (global::YS_Assist.SetActiveControl(referenceInfo4, flags7))
		{
			flag = true;
		}
		bool[] flags8 = new bool[]
		{
			2 == b
		};
		GameObject referenceInfo5 = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.S_SimpleHand);
		if (global::YS_Assist.SetActiveControl(referenceInfo5, flags8))
		{
			flag = true;
		}
		bool[] flags9 = new bool[]
		{
			0 != b,
			this.maleStatusInfo.tongueState != 0
		};
		GameObject referenceInfo6 = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.S_SimpleTongue);
		if (global::YS_Assist.SetActiveControl(referenceInfo6, flags9))
		{
			flag = true;
		}
		bool[] flags10 = new bool[]
		{
			1 == b
		};
		GameObject referenceInfo7 = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.S_SimpleBody);
		if (global::YS_Assist.SetActiveControl(referenceInfo7, flags10))
		{
			flag = true;
		}
		bool[] flags11 = new bool[]
		{
			base.chaInfo.visibleAll,
			1 == this.maleStatusInfo.visibleBodyAlways,
			this.maleStatusInfo.visibleSimple
		};
		GameObject referenceInfo8 = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.S_SimpleTop);
		if (global::YS_Assist.SetActiveControl(referenceInfo8, flags11))
		{
			flag = true;
		}
		bool[] flags12 = new bool[]
		{
			base.chaInfo.visibleAll,
			1 == b,
			1 == this.maleStatusInfo.visibleBodyAlways,
			!this.maleStatusInfo.visibleSimple,
			!this.mannequinMode
		};
		if (global::YS_Assist.SetActiveControl(base.objHead, flags12))
		{
			flag = true;
		}
		bool[] flags13 = new bool[]
		{
			this.mannequinMode
		};
		if (global::YS_Assist.SetActiveControl(base.objMannequinHead, flags13))
		{
			flag = true;
		}
		bool[] flags14 = new bool[]
		{
			this.maleStatusInfo.tongueState == 0
		};
		GameObject referenceInfo9 = base.chaInfo.GetReferenceInfo(global::CharReference.RefObjKey.S_TongueF);
		if (global::YS_Assist.SetActiveControl(referenceInfo9, flags14))
		{
			flag = true;
		}
		bool[] flags15 = new bool[]
		{
			base.chaInfo.visibleAll,
			1 == b,
			1 == this.maleStatusInfo.visibleBodyAlways,
			!this.maleStatusInfo.visibleSimple,
			!this.mannequinMode
		};
		if (global::YS_Assist.SetActiveControl(base.objHair[0], flags15))
		{
			flag = true;
		}
		bool[] flags16 = new bool[]
		{
			base.chaInfo.visibleAll,
			this.maleStatusInfo.clothesState[1] == 0,
			1 == b,
			1 == this.maleStatusInfo.visibleBodyAlways,
			!this.maleStatusInfo.visibleSimple
		};
		if (global::YS_Assist.SetActiveControl(base.objClothes[1], flags16))
		{
			flag = true;
		}
		for (int i = 0; i < base.objAccessory.Length; i++)
		{
			bool[] flags17 = new bool[]
			{
				base.chaInfo.visibleAll,
				this.maleStatusInfo.showAccessory[i],
				1 == b,
				1 == this.maleStatusInfo.visibleBodyAlways,
				!this.maleStatusInfo.visibleSimple
			};
			if (global::YS_Assist.SetActiveControl(base.objAccessory[i], flags17))
			{
				flag = true;
			}
		}
		if (flag)
		{
			base.chaInfo.updateShape = true;
		}
	}

	// Token: 0x06000F64 RID: 3940 RVA: 0x00070C98 File Offset: 0x0006EE98
	public override void UpdateSub()
	{
	}

	// Token: 0x06000F65 RID: 3941 RVA: 0x00070C9C File Offset: 0x0006EE9C
	public override void LateUpdateSub()
	{
	}

	// Token: 0x04001094 RID: 4244
	public global::CharMaleFile maleFile;

	// Token: 0x04001095 RID: 4245
	public global::CharFileInfoCustomMale maleCustomInfo;

	// Token: 0x04001096 RID: 4246
	public global::CharFileInfoClothesMale maleClothesInfo;

	// Token: 0x04001097 RID: 4247
	public global::CharFileInfoStatusMale maleStatusInfo;

	// Token: 0x04001098 RID: 4248
	public float sonRotTime = 1f;

	// Token: 0x04001099 RID: 4249
	public float sonRotDeltaTime;
}
